home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 75 / XENIATGM75.iso / Shareware / X-Setup 5.0 / _SETUP.1 / XQ Control Panel Hide 3.xpl < prev    next >
Text File  |  1999-07-12  |  3KB  |  106 lines

  1. "FILE"="Xteq Systems X-Setup Plugin 3.1"
  2. "TYPE"="6"
  3. "COUNT"="5"
  4. "UIPATH"="Appearance\General\Control Panel"
  5. "NAME"="Visible Items #3"
  6. "VERSION"="1.01"
  7. "LANGUAGE"="VBScript"
  8. "TEXT 1"="Display "Regional settings" applet"
  9. "TEXT 2"="Display "Email" applet"
  10. "TEXT 3"="Display "ODBC" applet"
  11. "TEXT 4"="Display "Power Management" applet"
  12. "TEXT 5"="Display "Mouse Control" applet"
  13. "DESCRIPTION 1"="This plug-in can be used to hide or show the different applets inside Start -> Settings -> Control Panel."
  14. "AUTHOR"="Xteq Systems"
  15. "COPYRIGHT"="Copyright ⌐ Xteq Systems - All Rights Reserved"
  16. "COMMENT 1"="For more information, go to http://www.xteq.com or write to TeXHeX@gmx.net."
  17. "COMMENT 2"="Special thanks to Maxwell (maxwello@hotpop.com) for his brilliant tips and CptSiskoX (CptSiskoX@flashmail.com) for his help."
  18. "COMMENT 3"="See also: MS KB Q207750"
  19.  
  20.  
  21. '******************************************************************
  22. '***                COPY !!!! ONLY EDIT LINES BELOW!!!!        ****
  23. '******************************************************************
  24. sVals=Array("intl.cpl","mlcfg32.cpl","odbccp32.cpl","powercfg.cpl","main.cpl") 
  25. sPath="HKCU\Control Panel\Don't Load\"
  26. sFile="CONTROL.INI"
  27. sFileSec="Don't Load"
  28. '******************************************************************
  29. '*** Keep an eye on the order (must be the same as "TEXT x") ! ****
  30. '******************************************************************
  31.  
  32.  
  33.  
  34. SUB Plugin_Initialize
  35.  for i=0 to UBound(sVals)
  36.      Call ReadIt(i+1,sVals(i)) 
  37.  next 
  38. END SUB
  39.  
  40. Sub ReadIt(ITM,VAL)
  41.   If GetWinVer=2 then
  42.  
  43.      s=RegReadValue(sPath & VAL)
  44.      if IsEmpty(s)=true then
  45.         Call SetUIElement(ITM,true)
  46.      else
  47.         Call SetUIElement(ITM,false)
  48.      end if
  49.  
  50.   else
  51.  
  52.     s=IniReadValue(sFile,sFileSec,VAL)
  53.     if len(s)>0 then
  54.        Call SetUIElement(ITM,false)
  55.     else
  56.        Call SetUIElement(ITM,true)
  57.     end if
  58.      
  59.   end if
  60.      
  61. End Sub
  62.  
  63. 'Called when the Plugin should validate the Data the user has entered
  64. SUB Plugin_CheckData(ElementIndex)
  65. END SUB
  66.  
  67. 'Called when the Plugin should apply the changes
  68. SUB Plugin_Apply(ElementIndex,ElementSubIndex)
  69.  for i=0 to UBound(sVals)
  70.      Call WriteIt(i+1,sVals(i)) 
  71.  next 
  72. END SUB
  73.  
  74. Sub WriteIt(ITM,VAL)
  75.  b=GetUIElement(ITM)
  76.  if b=true then
  77.     'Display it
  78.  
  79.     if GetWinVer=2 then  
  80.        s=RegReadValue(sPath & VAL)
  81.        if IsEmpty(s)=false then
  82.           Call RegDeleteValue(sPath & VAL)
  83.        end if
  84.     else
  85.        Call IniWriteValue(sFile,sFileSec,VAL,"")
  86.     end if
  87.  
  88.  else
  89.    'Hide it
  90.    
  91.    if GetWinVer=2 then
  92.       Call RegWriteValue(sPath & VAL,"1",1) 
  93.    else
  94.       Call IniWriteValue(sFile,sFileSec,VAL,"no")
  95.    end if
  96.  
  97.  end if   
  98. End Sub
  99.  
  100.  
  101. 'Called when the Plugin is about to be removed from memory
  102. SUB Plugin_Terminate
  103. END SUB
  104.  
  105.  
  106.